$(document).ready(() => {
    $(function () {
        // 1、点击×号，关闭广告，下面的搜索框到顶部来
        $('.close-btn').click(function () {
            $('header').css('display', 'none')
            // 添加一点动画效果
            $('.header-search').animate({
                top: 0
            }, 500).fadeIn()

        })

        // 2、手指触摸的后离开小x号，关闭广告
        $('.close-btn').touchend(() => {
            $('header').css('display', 'none')
            // 添加一点动画效果
            $('.header-search').animate({
                top: 0
            }, 500).fadeIn()
        })



        // 2、swiper插件的js-轮播图
        var swiper = new Swiper('.swiper-container', {
            spaceBetween: 30,
            centeredSlides: true,
            autoplay: {
                delay: 2500,
                disableOnInteraction: false,
            },
            pagination: {
                el: '.swiper-pagination',
                clickable: true,
            },
            navigation: {
                nextEl: '.swiper-button-next',
                prevEl: '.swiper-button-prev',
            },
        });
    })
})